import { request, MyRequest } from "@/plugins";
import { AxiosRequestConfig } from "axios";
import { IManagement } from "../interface/management";

export const getManagementList = <T = IManagement.ResManagementList>(
  data: any
) => MyRequest<T>({ method: "post", url: "/api/task/list", data });

export const createManagement = <T>(data: any) =>
  MyRequest<T>({ method: "post", url: "/api/task/create", data });

export const start = <T>(data: any) =>
    MyRequest<T>({ method: "post", url: "/api/task/start", data });


export const updateManagement = <T>(data: any) =>
  MyRequest<T>({ method: "post", url: "/api/task/update", data });

export const batchUpdate = <T>(data: any) =>
  MyRequest<T>({ method: "post", url: "/api/task/batch/update", data });

export const getManagementDetail = <T = IManagement.ResManagementItem>(
  data: any
) =>
  MyRequest<T>({
    method: "post",
    url: "/api/task/detail",
    data,
  });

export const report = <T>(data: any) =>
  MyRequest<T>({ method: "post", url: "/api/task/report", data });

export const updateStatus = <T>(data: any) =>
  request<T>({ method: "put", url: "/api/v1/rule/manage/rule/status", data });



